package com.forenow.zuoye;

public class Rectangle {
    int length;

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    int width;


    public Rectangle(int width, int length ){
       this.width=width;
       this.length=length;
    }
    public void getArea(){
        System.out.println("面积为："+length*width);
    }
    public void getPer(){
        System.out.println(("周长为："+(length+width)*2));
    }
    public void showAll(){
        System.out.println("面积为："+length*length);
        System.out.println("周长为："+(length+width)*2);
        System.out.println("长："+length+","+"宽："+width);
    }

    public static void main(String[] args) {
        Rectangle r1=new Rectangle(10,20);
        r1.getArea();
        r1.getPer();
        r1.showAll();
    }
}
